const router = require('koa-router')()

const Dict = require('../models/dict')
//字典
router.get('/',async ctx => {
    ctx.body = await Dict.findOne()
})


router.post('/',async ctx => {
    ctx.body = await Dict.create({})
})

//GPS字典
const gpsDict = require('../models/gpsDict')
router.get('/location',async ctx => {
    ctx.body = await gpsDict.find()
})

router.post('/location',async ctx => {
    let obj = ctx.request.body
    ctx.body = await gpsDict.create(obj)
})

module.exports = router
